const path = require('path')

let str = '/a/b/c/index.html'
let img = '/a/b/c/index.png'

console.log('---文件名---')
let bname = path.basename(str)
console.log(bname)
let bname_ = path.basename(img)
console.log(bname_)


console.log('---后缀名---')
let lname = path.extname(img)
console.log(lname)
let lname_ = path.extname(str)
console.log(lname_)

console.log('---绝对路径---')
let resolve = path.resolve(__dirname,'./baz')
console.log(resolve)